package com.yic.module.base.api.center;

import cn.hutool.core.util.ObjectUtil;
import com.yic.module.base.api.center.dto.CenterRespDTO;
import com.yic.module.base.convert.center.CenterConvert;
import com.yic.module.base.dal.dataobject.center.CenterDO;
import com.yic.module.base.service.center.CenterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName CenterApiImpl
 * @Description 工作中心api实现类
 * @Author Lijx
 * @Date 2023/10/21 8:15
 * @Version 1.0
 */
@Service
public class CenterApiImpl implements CenterApi {

    @Resource
    private CenterService centerService;

    @Override
    public CenterRespDTO getCenter(Long id) {
        if (ObjectUtil.isNull(id)){
            return null;
        }
        CenterDO center = centerService.getCenter(id);
        return CenterConvert.INSTANCE.convert01(center);
    }
}
